package ru.arriah.servicedesk.bean;

import java.sql.ResultSet;
import java.sql.SQLException;

import ru.arriah.common.bean.GenericBean;

public class MailTemplateBean extends GenericBean {

   private String body;
   private String subject;
   private String key;

   public MailTemplateBean() {
      super();
   }
   
   public MailTemplateBean(ResultSet resultSet) {
      fillFromResultSet(resultSet);
   }
   
   public String getKey() {
      return key;
   }

   public void setKey(String key) {
      this.key = key;
   }

   public String getBody() {
      return body;
   }

   public void setBody(String body) {
      this.body = body;
   }

   public String getSubject() {
      return subject;
   }

   public void setSubject(String subject) {
      this.subject = subject;
   }

   @Override
   public boolean isValid() {
      // TODO Auto-generated method stub
      return false;
   }

   @Override
   public void fillFromResultSet(ResultSet resultSet) {
      try {
         setId(resultSet.getInt("mailtemplate.id"));
         setBody(resultSet.getString("mailtemplate.body"));
         setSubject(resultSet.getString("mailtemplate.subject"));
         setKey(resultSet.getString("mailtemplate.key"));
      } catch (SQLException e) {
         // TODO Auto-generated catch block
         e.printStackTrace();
      }
   }
}